package test1223;

public class Test02 {
    public static void main(String[] args) {

        // (2)打印5位数各个位的数字
        int value = 12345;

        // 分解并打印每一位
        int a = value / 10000;
        int b = (value / 1000) % 10;
        int c = (value / 100) % 10;
        int d = (value / 10) % 10;
        int e = value % 10;

        System.out.println("万位: " + a);
        System.out.println("千位: " + b);
        System.out.println("百位: " + c);
        System.out.println("十位: " + d);
        System.out.println("个位: " + e);
    }
}
